<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>-欢迎登录-</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <link rel="stylesheet" href="css/main.css">
  </head>
  <body>
    <!--导航栏-->
      <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container-fluid">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#log-and-re" aria-expanded="false">
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
              <a href="#" class="navbar-brand">
                <img src="..." alt="中国文艺志愿者协会会员中心">
              </a>
          </div>

          <div id="log-and-re" class="collapse navbar-collapse navbar-right">
            <p class="navbar-text">亲，请<a href="#">登录</a>/<a href="#">注册</a></p>
          </div>
        </div>
      </nav>
    <!--导航栏结束-->

      <div class="main-wrap">
        <div class="container">
          <!--登录窗口-->
          <div class="login-form">
            <div class="login-form-header">账户登录</div>
            <div class="login-box">
              <div class="item">
                <lable class="login-lable" style="background: url(./icon/usrname.png) no-repeat;background-position: 0 0;"></lable>
                <input type="text" id="usrName" name="usrName" class="form-text" tabindex="1" autocomplete="off" placeholder="邮箱/用户名/已验证手机">
              </div>
              <div class="item">
                <lable class="login-lable" style="background: url(./icon/usrcode.png) no-repeat;background-position: 0 0;"></lable>
                <input type="password" id="usrCode" name="usrCode" class="form-text" tabindex="1" autocomplete="off" placeholder="密码">
              </div>
              
             <div class="item">
                <button id="submit" class="btn btn-primary login-btn">登录</button>
             </div>
             <div class="item">
                <div class="safe">
                  <span class="register-usr"><a href="#">立即注册</a></span>
                  <span class="forget-pw-safe">忘记
                    <a href="#">密码</a>/<a href="">用户名</a>
                  </span>
                </div>
              </div>
            </div>
          </div>
          <!--登录窗口结束-->
        </div>
      </div>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>

    <script>
      $(document).ready(function(){
        $('input:text:first').focus();

        $('input:text').bind('keydown',function(element){
          
          if(element.keyCode == 13){
            element.preventDefault();
            if($('#usrName').val() == ''){
              $('#usrName').attr('placeholder','*请输入用户名');
              $('#usrName').css({
                "border":"1px solid #8B0000",
              })
            }
            $('#usrCode').focus();
          }
          else{
            // 用于纠错
          }
        });

        $('#usrCode').bind('keydown',function(element){
          if(element.keyCode == 13){
            element.preventDefault();
            if($('#usrCode').val() == ''){
              $('#usrCode').css({
                "border":"1px solid #8B0000",
              })
            }
            else{
              $('#submit').click();
              // $("#submit").css({
              //   "background":"#fff",
              // })
            }
          }
        })


      });
    </script>
  </body>
</html>